export const ERRORS_COLUMN = {
  title: '禁止提交原因',
  key: 'errorMsg',
  fixed: 'left',
  width: '130',
  sortable: true,
  errorTip: true,
  notShowTip: true,
}
export const TIPS_COLUMN = {
  title: '异常提示',
  key: 'tipMsg',
  fixed: 'left',
  width: '120',
  sortable: true,
  errorTip: true,
  notShowTip: true,
}
// 修改进价单计量表头
export const ENTER_PRICE_SINGLE_COLUMNS = [
  {
    title: '供应商编码',
    key: 'supplyUuid',
    fixed: 'left',
    width: 110,
    sortable: true,
  },
  {
    title: '供应商名称',
    key: 'supplyName',
    fixed: 'left',
    width: '100',
    render: (h, {
      row
    }) => {
      return row.supplyInfoDTO ? (<span>{ row.supplyInfoDTO.supplyName }</span>) : ('');
    }
  },
  {
    title: 'SKU编码',
    key: 'skuNo',
    fixed: 'left',
    width: '100',
    sortable: true
  },
  {
    title: '商品名称',
    key: 'productName',
    fixed: 'left',
    width: '100',
    sortable: true,
  },
  {
    title: '规格',
    key: 'specDetailStr',
    fixed: 'left',
    width: '90',
    sortable: true,
  },
  {
    title: '参照城市',
    key: 'templateCityName',
    fixed: 'left',
    width: 100,
    sortable: true,
  },
  {
    title: '主计量单位',
    key: 'unitName',
    width: '90',
    render: (h, {
      row
    }) => {
      return <span> { row.supplyProductInfo ? row.supplyProductInfo.unitName : '' } </span>;
    }
  },
  {
    title: '供应商管理区域',
    key: 'supplyManagerArea',
    render: (h, {
      row
    }) => {
      return row.supplyInfoDTO ? (<span> { row.supplyInfoDTO.supplyManagerArea } </span>) : ('');
    }
  },
  {
    title: '是否敏感',
    key: 'isPriceSensitive',
    render: (h, {
      row
    }) => {
      let isPriceSensitive = '';
      if (row.supplyProductInfo) {
        if (row.supplyProductInfo.isPriceSensitive == '1') {
          isPriceSensitive = '是'
        } else if (row.supplyProductInfo.isPriceSensitive == '2') {
          isPriceSensitive = '否'
        }
      }
      return <span> { isPriceSensitive } </span>;
    }
  },
  {
    title: '商品管理区域',
    key: 'manageArea',
    render: (h, {
      row
    }) => {
      return <span> { row.supplyProductInfo.manageArea } </span>;
    }
  },
  {
    title: '业务区域',
    key: 'templateCitySaleAreaName',
    width: 100,
    sortable: true,
  },
  {
    title: '进价类型',
    key: 'purchasePriceTypeStr',
  },
  {
    title: '进价',
    children: [
      {
        title: '原进价',
        key: 'mainPurchasePrice'
      },
      {
        title: '现进价',
        key: 'mainPurchasePriceUpdate',
        width: 160,
        type: 'inputNumChange',
        precision: 3
      }
    ]
  },
  {
    title: '进价备注',
    align: 'center',
    children: [
      {
        title: '原值',
        key: 'purchasePriceNote'
      },
      {
        title: '现值',
        key: 'purchasePriceNoteUpdate',
        width: 200,
        type: 'inputNoLimit',
        maxlength: 200
      }
    ]
  },
  {
    title: '进价浮动比率',
    key: 'mainPurchasePriceFloatRadio',
    width: 120,
    sortable: true
  },
  {
    title: '加价类型',
    key: 'addPriceTypeStr',
  },
  {
    title: '运费比例或金额',
    children: [
      {
        title: '原值',
        key: 'freightRatio',
      },
      {
        title: '现值',
        key: 'freightRatioUpdate',
        width: 160,
        type: 'inputNumChange',
        precision: 3
      }
    ]
  },
  {
    title: '包装比例或金额',
    children: [
      {
        title: '原值',
        key: 'packRatio',
      },
      {
        title: '现值',
        key: 'packRatioUpdate',
        width: 160,
        type: 'inputNumChange',
        precision: 3
      }
    ]
  },
  {
    title: '加工费比例或金额',
    align: 'center',
    children: [
      {
        title: '原值',
        key: 'processChargesRatio',
      },
      {
        title: '现值',
        key: 'processChargesRatioUpdate',
        width: 160,
        type: 'inputNumChange',
        precision: 3
      }
    ]
  },
  {
    title: '返利折合比例或金额',
    children: [
      {
        title: '原值',
        key: 'rebateRatio',
      },
      {
        title: '现值',
        key: 'rebateRatioUpdate',
        width: 160,
        type: 'inputNumChange',
        precision: 3
      }
    ]
  },
  {
    title: '返利说明',
    children: [
      {
        title: '原值',
        key: 'rebateRatioDesc',
      },
      {
        title: '现值',
        key: 'rebateRatioDescUpdate',
        width: 160,
        type: 'inputNoLimit',
        maxlength: 300
      }
    ]
  },
  {
    title: '成本价',
    align: 'center',
    children: [
      {
        title: '原值',
        key: 'mainUnitCostPrice',
      },
      {
        title: '现值',
        key: 'mainUnitCostPriceUpdate',
      }
    ]
  },
  {
    title: '成本价浮动比率',
    key: 'mainUnitCostFloatPrice',
    width: 130,
    sortable: true
  },
  {
    title: '发票类型',
    key: 'invoiceTypeName'
  },
  {
    title: '税率',
    key: 'taxRate'
  },
  {
    title: '厂家代码',
    key: 'factoryCode',
  },
  {
    title: '厂家面价',
    children: [
      {
        title: '原价',
        key: 'factoryFacePrice',
      },
      {
        title: '现价',
        key: 'factoryFacePriceUpdate',
        width: 160,
        type: 'inputNum'
      }
    ]
  },
  {
    title: '厂家调价原因',
    key: 'changePriceReason',
    width: 200,
    type: 'inputNoLimit',
    maxlength: 200
  },
  {
    title: '竞争对手',
    key: 'opponentName',
    width: 120,
    type: 'input'
  },
  {
    title: '落实开票价格',
    key: 'invoicePrice',
    width: 160,
    type: 'inputNum'
  },
  {
    title: '我司进价与竞争对手差额比例',
    key: 'opponentRatio',
    width: 180,
    type: 'inputNumNoLimit'
  },
  {
    title: '操作',
    key: 'action',
    fixed: 'right',
    width: 80
  }
]
// 修改进价多计量表头
export const ENTER_PRICE_MULTIPLE_COLUMNS = [
  {
    title: '供应商编码',
    key: 'supplyUuid',
    fixed: 'left',
    sortable: true,
    width: 110,
  },
  {
    title: '供应商名称',
    key: 'supplyName',
    fixed: 'left',
    width: 100,
    render: (h, { row }) => {
      return (
        <span>{row.supplyInfoDTO ? row.supplyInfoDTO.supplyName : ''}</span>
      );
    }
  },
  {
    title: 'SKU编码',
    key: 'skuNo',
    fixed: 'left',
    width: 100,
    sortable: true
  },
  {
    title: '商品名称',
    key: 'productName',
    fixed: 'left',
    sortable: true,
    width: 100,
  },
  {
    title: '规格',
    key: 'specDetailStr',
    fixed: 'left',
    sortable: true,
    width: 80,
  },
  // 新增字段
  {
    title: '参照城市',
    key: 'templateCityName',
    fixed: 'left',
    sortable: true,
    width: 100,
  },
  {
    title: '供货计量单位',
    key: 'supplyGoodsUnit',
    width: 100,
    render: (h, { row }) => {
      return <span>{row.supplyProductInfo.supplyGoodsUnit}</span>;
    }
  },
  {
    title: '主计量单位',
    key: 'unitName',
    width: 90,
    render: (h, { row }) => {
      return <span>{row.supplyProductInfo.unitName}</span>;
    }
  },
  {
    title: '供应商管理区域',
    key: 'supplyManagerArea',
    width: 110,
    render: (h, { row }) => {
      return (
        <span>
          {row.supplyInfoDTO ? row.supplyInfoDTO.supplyManagerArea : ''}
        </span>
      );
    }
  },
  {
    title: '是否敏感',
    key: 'isPriceSensitive',
    render: (h, { row }) => {
      let isPriceSensitive = '';
      if (row.supplyProductInfo) {
        if (row.supplyProductInfo.isPriceSensitive == '1') {
          isPriceSensitive = '是'
        } else if (row.supplyProductInfo.isPriceSensitive == '2') {
          isPriceSensitive = '否'
        }
      }
      return <span>{ isPriceSensitive }</span>;
    }
  },
  {
    title: '商品管理区域',
    key: 'manageArea',
    render: (h, { row }) => {
      return <span>{ row.supplyProductInfo ? row.supplyProductInfo.manageArea : ''}</span>;
    }
  },
  {
    title: '业务区域',
    key: 'templateCitySaleAreaName',
    sortable: true,
    width: 100,
  },
  {
    title: '销售区域',
    key: 'saleAreaShortNames',
    render: (h, { row }) => {
      return <span>{row.supplyProductInfo.saleAreaShortNames}</span>;
    }
  },
  // 新增字段
  {
    title: '进价类型',
    key: 'purchasePriceTypeStr',
  },
  {
    title: '理论转换率',
    key: 'theoryConvertRatio',
    width: 100,
  },
  {
    title: '实际转换率',
    key: 'actualConvertRatio',
    width: 100,
  },
  {
    title: '异常转换率',
    key: 'abnormalPurchaseConvertRatioUpdate',
    width: 160,
    type: 'inputNumChange'
  },
  {
    title: '辅计量进价',
    children: [
      {
        title: '原值',
        key: 'purchasePrice',
      },
      {
        title: '现值',
        key: 'purchasePriceUpdate',
        width: 160,
        type: 'inputNumChange',
        precision: 3
      }
    ]
  },
  {
    title: '进价备注',
    children: [
      {
        title: '原值',
        key: 'purchasePriceNote',
      },
      {
        title: '现值',
        key: 'purchasePriceNoteUpdate',
        width: 200,
        type: 'inputNoLimit',
        maxlength: 200
      }
    ]
  },
  {
    title: '主计量进价',
    children: [
      {
        title: '原值',
        key: 'mainPurchasePrice',
      },
      {
        title: '现值',
        key: 'mainPurchasePriceUpdate',
      }
    ]
  },
  {
    title: '主计量进价浮动比率',
    key: 'mainPurchasePriceFloatRadio',
    sortable: true,
    width: 160,
  },
  {
    title: '加价类型',
    key: 'addPriceTypeStr',
  },
  {
    title: '运费比例或金额',
    children: [
      {
        title: '原值',
        key: 'freightRatio',
      },
      {
        title: '现值',
        key: 'freightRatioUpdate',
        width: '160',
        type: 'inputNumChange',
        precision: 3
      }
    ]
  },
  {
    title: '包装比例或金额',
    children: [
      {
        title: '原值',
        key: 'packRatio',
      },
      {
        title: '现值',
        key: 'packRatioUpdate',
        width: '160',
        type: 'inputNumChange',
        precision: 3
      }
    ]
  },
  {
    title: '加工费比例或金额',
    children: [
      {
        title: '原值',
        key: 'processChargesRatio',
      },
      {
        title: '现值',
        key: 'processChargesRatioUpdate',
        width: '160',
        type: 'inputNumChange',
        precision: 3
      }
    ]
  },
  {
    title: '返利折合比例或金额',
    minWidth: 180,
    children: [
      {
        title: '原值',
        key: 'rebateRatio',
      },
      {
        title: '现值',
        key: 'rebateRatioUpdate',
        width: '160',
        type: 'inputNumChange',
        precision: 3
      }
    ]
  },
  {
    title: '返利说明',
    children: [
      {
        title: '原值',
        key: 'rebateRatioDesc',
      },
      {
        title: '现值',
        key: 'rebateRatioDescUpdate',
        width: 160,
        type: 'inputNoLimit',
        maxlength: 300
      }
    ]
  },
  {
    title: '实际转换率辅计量成本价',
    children: [
      {
        title: '原值',
        key: 'actualConvertRatioCostPrice',
      },
      {
        title: '现值',
        key: 'actualConvertRatioCostPriceUpdate',
      }
    ]
  },
  {
    title: '理论转换率辅计量成本价',
    children: [
      {
        title: '原值',
        key: 'theoryConvertRatioCostPrice',
      },
      {
        title: '现值',
        key: 'theoryConvertRatioCostPriceUpdate',
      }
    ]
  },
  {
    title: '主计量成本价',
    children: [
      {
        title: '原值',
        key: 'mainUnitCostPrice',
      },
      {
        title: '现值',
        key: 'mainUnitCostPriceUpdate',
      }
    ]
  },
  {
    title: '主计量成本价浮动比率',
    key: 'mainUnitCostFloatPrice',
    sortable: true,
    width: 165,
  },
  {
    title: '发票类型',
    key: 'invoiceTypeName'
  },
  {
    title: '税率',
    key: 'taxRate'
  },
  {
    title: '厂家面价',
    children: [
      {
        title: '原值',
        key: 'factoryFacePrice',
      },
      {
        title: '现值',
        key: 'factoryFacePriceUpdate',
        width: '160',
        type: 'inputNum'
      }
    ]
  },
  {
    title: '厂家调价原因',
    key: 'changePriceReason',
    width: 200,
    type: 'inputNoLimit',
    maxlength: 200
  },
  {
    title: '竞争对手',
    key: 'opponentName',
    width: 120,
    type: 'input'
  },
  {
    title: '落实开票价格',
    key: 'invoicePrice',
    width: 160,
    type: 'inputNum'
  },
  {
    title: '我司进价与竞争对手差额比例',
    key: 'opponentRatio',
    width: 180,
    type: 'inputNumNoLimit'
  },
  {
    title: '操作',
    key: 'action',
    fixed: 'right',
    width: 80
  }
]
// 关联商品表头
export const LINK_COLUMNS = [
  {
    type: 'selection',
    width: 60,
    align: 'center',
    fixed: 'left'
  },
  {
    title: '供应商编码',
    key: 'supplyUuid',
    align: 'center'
  },
  {
    title: '供应商名称',
    key: 'supplyName',
    align: 'center'
  },
  {
    title: '商品名称',
    key: 'productName',
    align: 'center'
  },
  {
    title: '商品分类',
    key: 'categoryPath',
    align: 'center'
  },
  {
    title: 'SPU编码',
    key: 'spuNo',
    align: 'center'
  },
  {
    title: 'SKU编码',
    key: 'skuNo',
    align: 'center'
  },
  {
    title: '销售区域',
    key: 'areaName',
    align: 'center'
  },
  {
    title: '销售省',
    key: 'saleProvinceName',
    align: 'center'
  },
  {
    title: '规格参数',
    key: 'specDetail',
    align: 'center'
  },
  {
    title: '品牌',
    key: 'brandName',
    align: 'center'
  },
  {
    title: '操作',
    slot: 'action',
    fixed: 'right',
    minWidth: 100
  }
]
